<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>restclient-cpp: include/restclient-cpp/connection.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">restclient-cpp
   </div>
   <div id="projectbrief">C++ client for making HTTP/REST requests</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_d7863d21b35bfd92001c24d3be435c80.html">restclient-cpp</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">connection.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="connection_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#ifndef INCLUDE_RESTCLIENT_CPP_CONNECTION_H_</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#define INCLUDE_RESTCLIENT_CPP_CONNECTION_H_</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;curl/curl.h&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;cstdlib&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="restclient_8h.html">restclient-cpp/restclient.h</a>&quot;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &quot;restclient-cpp/version.h&quot;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="namespace_rest_client.html">   23</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_rest_client.html">RestClient</a> {</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="class_rest_client_1_1_connection.html">   28</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_rest_client_1_1_connection.html">Connection</a> {</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_request_info.html">   60</a></span>&#160;    <span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_request_info.html#a5febf41f2662384129b874e195e1c01e">   61</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="struct_rest_client_1_1_connection_1_1_request_info.html#a5febf41f2662384129b874e195e1c01e">totalTime</a>;</div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_request_info.html#a73d3bab1fd832feb912f1e20656b185d">   62</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="struct_rest_client_1_1_connection_1_1_request_info.html#a73d3bab1fd832feb912f1e20656b185d">nameLookupTime</a>;</div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_request_info.html#a7c8347cc41e35a944663d333baea88a9">   63</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="struct_rest_client_1_1_connection_1_1_request_info.html#a7c8347cc41e35a944663d333baea88a9">connectTime</a>;</div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_request_info.html#a05d4f74f97a3e02cb9bbe3a6039135bc">   64</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="struct_rest_client_1_1_connection_1_1_request_info.html#a05d4f74f97a3e02cb9bbe3a6039135bc">appConnectTime</a>;</div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_request_info.html#abcccb563d60a3f5325918ef912130e16">   65</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="struct_rest_client_1_1_connection_1_1_request_info.html#abcccb563d60a3f5325918ef912130e16">preTransferTime</a>;</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_request_info.html#a022ad817c51c37e781d3ef6590b47d96">   66</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="struct_rest_client_1_1_connection_1_1_request_info.html#a022ad817c51c37e781d3ef6590b47d96">startTransferTime</a>;</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_request_info.html#af219b63ad58cb52748ba7afd5b2290aa">   67</a></span>&#160;        <span class="keywordtype">double</span> <a class="code" href="struct_rest_client_1_1_connection_1_1_request_info.html#af219b63ad58cb52748ba7afd5b2290aa">redirectTime</a>;</div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_request_info.html#ab0240290fa51b11468936199ff0c248f">   68</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="struct_rest_client_1_1_connection_1_1_request_info.html#ab0240290fa51b11468936199ff0c248f">redirectCount</a>;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;      } <a class="code" href="struct_rest_client_1_1_connection_1_1_request_info.html">RequestInfo</a>;</div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_info.html">   93</a></span>&#160;    <span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_info.html#ae908949ed901ed0883da20efad56cf67">   94</a></span>&#160;      std::string <a class="code" href="struct_rest_client_1_1_connection_1_1_info.html#ae908949ed901ed0883da20efad56cf67">baseUrl</a>;</div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_info.html#a8e9c9ad0c74a6e6f5c73ced7306464d1">   95</a></span>&#160;      <a class="code" href="namespace_rest_client.html#ab2bbc7fd5ec10171e4e1fb2d7fc8e865">RestClient::HeaderFields</a> <a class="code" href="struct_rest_client_1_1_connection_1_1_info.html#a8e9c9ad0c74a6e6f5c73ced7306464d1">headers</a>;</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_info.html#a0a63e442ce474e50017fcbae563c4a7c">   96</a></span>&#160;      <span class="keywordtype">int</span> <a class="code" href="struct_rest_client_1_1_connection_1_1_info.html#a0a63e442ce474e50017fcbae563c4a7c">timeout</a>;</div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_info.html#a4b194ea487bf48f55e597b3146bc0c9b">   97</a></span>&#160;      <span class="keywordtype">bool</span> <a class="code" href="struct_rest_client_1_1_connection_1_1_info.html#a4b194ea487bf48f55e597b3146bc0c9b">followRedirects</a>;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;      <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        std::string username;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        std::string password;</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;      } basicAuth;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;      std::string certPath;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;      std::string certType;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;      std::string keyPath;</div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_info.html#a8cec6f505e26773638ea7c2df895b5e8">  106</a></span>&#160;      std::string <a class="code" href="struct_rest_client_1_1_connection_1_1_info.html#a8cec6f505e26773638ea7c2df895b5e8">customUserAgent</a>;</div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_connection_1_1_info.html#ac9393ffec292dc9ef1f9378bf0df5f31">  107</a></span>&#160;      <a class="code" href="struct_rest_client_1_1_connection_1_1_request_info.html">RequestInfo</a> <a class="code" href="struct_rest_client_1_1_connection_1_1_info.html#ac9393ffec292dc9ef1f9378bf0df5f31">lastRequest</a>;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    } <a class="code" href="struct_rest_client_1_1_connection_1_1_info.html">Info</a>;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keyword">explicit</span> <a class="code" href="class_rest_client_1_1_connection.html#a658af2c6d1300c8a02e7f6436b43b4c9">Connection</a>(<span class="keyword">const</span> std::string&amp; baseUrl);</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    ~<a class="code" href="class_rest_client_1_1_connection.html">Connection</a>();</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <span class="comment">// Instance configuration methods</span></div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="comment">// configure basic auth</span></div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_rest_client_1_1_connection.html#a9fdc2ee1b3b2cc2cca1f9fd29e6fd73f">SetBasicAuth</a>(<span class="keyword">const</span> std::string&amp; username,</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;                      <span class="keyword">const</span> std::string&amp; password);</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="comment">// set connection timeout to seconds</span></div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_rest_client_1_1_connection.html#ad7b6f92f59861b4c8dc914d4d226d89d">SetTimeout</a>(<span class="keywordtype">int</span> seconds);</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="comment">// set whether to follow redirects</span></div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_rest_client_1_1_connection.html#a77c9d405950492f9bcec21ce79edd2b3">FollowRedirects</a>(<span class="keywordtype">bool</span> follow);</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="comment">// set custom user agent</span></div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="comment">// (this will result in the UA &quot;foo/cool restclient-cpp/VERSION&quot;)</span></div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_rest_client_1_1_connection.html#a3e510fdf8291e9e277df72b0fae0a111">SetUserAgent</a>(<span class="keyword">const</span> std::string&amp; userAgent);</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <span class="comment">// set the Certificate Authority (CA) Info which is the path to file holding</span></div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="comment">// certificates to be used to verify peers. See CURLOPT_CAINFO</span></div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_rest_client_1_1_connection.html#afd74a344a00b58fc6997e34c37dde834">SetCAInfoFilePath</a>(<span class="keyword">const</span> std::string&amp; caInfoFilePath);</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="comment">// set CURLOPT_SSLCERT</span></div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="keywordtype">void</span> SetCertPath(<span class="keyword">const</span> std::string&amp; cert);</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <span class="comment">// set CURLOPT_SSLCERTTYPE</span></div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keywordtype">void</span> SetCertType(<span class="keyword">const</span> std::string&amp; type);</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="comment">// set CURLOPT_SSLKEY. Default format is PEM</span></div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    <span class="keywordtype">void</span> SetKeyPath(<span class="keyword">const</span> std::string&amp; keyPath);</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    std::string <a class="code" href="class_rest_client_1_1_connection.html#aa4353eb1df932b254aa02446f4ac3b32">GetUserAgent</a>();</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <a class="code" href="struct_rest_client_1_1_connection_1_1_info.html">RestClient::Connection::Info</a> <a class="code" href="class_rest_client_1_1_connection.html#ac489a801edc621a384cdfb29e7071231">GetInfo</a>();</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="comment">// set headers</span></div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_rest_client_1_1_connection.html#a6af41bf467a80deb83f20044f2c17344">SetHeaders</a>(<a class="code" href="namespace_rest_client.html#ab2bbc7fd5ec10171e4e1fb2d7fc8e865">RestClient::HeaderFields</a> headers);</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    <span class="comment">// get headers</span></div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <a class="code" href="namespace_rest_client.html#ab2bbc7fd5ec10171e4e1fb2d7fc8e865">RestClient::HeaderFields</a> <a class="code" href="class_rest_client_1_1_connection.html#afa869b17f4fb6387c057bfb9fcbd0bbf">GetHeaders</a>();</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="comment">// append additional headers</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_rest_client_1_1_connection.html#a60fd7521bfb4f604e6c7cdd278f038b3">AppendHeader</a>(<span class="keyword">const</span> std::string&amp; key,</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;                      <span class="keyword">const</span> std::string&amp; value);</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="comment">// Basic HTTP verb methods</span></div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <a class="code" href="struct_rest_client_1_1_response.html">RestClient::Response</a> <span class="keyword">get</span>(<span class="keyword">const</span> std::string&amp; uri);</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <a class="code" href="struct_rest_client_1_1_response.html">RestClient::Response</a> <a class="code" href="class_rest_client_1_1_connection.html#a76b11e6e01fb84cafdacf99e49aae6a7">post</a>(<span class="keyword">const</span> std::string&amp; uri,</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;                              <span class="keyword">const</span> std::string&amp; data);</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <a class="code" href="struct_rest_client_1_1_response.html">RestClient::Response</a> <a class="code" href="class_rest_client_1_1_connection.html#af1a30c5aa6a646e6bad4caf2abb7084c">put</a>(<span class="keyword">const</span> std::string&amp; uri,</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;                             <span class="keyword">const</span> std::string&amp; data);</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    <a class="code" href="struct_rest_client_1_1_response.html">RestClient::Response</a> <a class="code" href="class_rest_client_1_1_connection.html#a4a14035f66375a7291f9d16d87db41f2">del</a>(<span class="keyword">const</span> std::string&amp; uri);</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <a class="code" href="struct_rest_client_1_1_response.html">RestClient::Response</a> <a class="code" href="class_rest_client_1_1_connection.html#a64f085227c8c4d47dc6c84fea4f71398">head</a>(<span class="keyword">const</span> std::string&amp; uri);</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    CURL* curlHandle;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    std::string baseUrl;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <a class="code" href="namespace_rest_client.html#ab2bbc7fd5ec10171e4e1fb2d7fc8e865">RestClient::HeaderFields</a> headerFields;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordtype">int</span> timeout;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="keywordtype">bool</span> followRedirects;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;      std::string username;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;      std::string password;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    } basicAuth;</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    std::string customUserAgent;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    std::string caInfoFilePath;</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    RequestInfo lastRequest;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    std::string certPath;</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    std::string certType;</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    std::string keyPath;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    <a class="code" href="struct_rest_client_1_1_response.html">RestClient::Response</a> performCurlRequest(<span class="keyword">const</span> std::string&amp; uri);</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;};</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;};  <span class="comment">// namespace RestClient</span></div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;<span class="preprocessor">#endif  // INCLUDE_RESTCLIENT_CPP_CONNECTION_H_</span></div>
<div class="ttc" id="struct_rest_client_1_1_response_html"><div class="ttname"><a href="struct_rest_client_1_1_response.html">RestClient::Response</a></div><div class="ttdoc">This structure represents the HTTP response data. </div><div class="ttdef"><b>Definition:</b> restclient.h:38</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_afa869b17f4fb6387c057bfb9fcbd0bbf"><div class="ttname"><a href="class_rest_client_1_1_connection.html#afa869b17f4fb6387c057bfb9fcbd0bbf">RestClient::Connection::GetHeaders</a></div><div class="ttdeci">RestClient::HeaderFields GetHeaders()</div><div class="ttdoc">get all custom headers set on the connection </div><div class="ttdef"><b>Definition:</b> connection.cc:105</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_request_info_html_a5febf41f2662384129b874e195e1c01e"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_request_info.html#a5febf41f2662384129b874e195e1c01e">RestClient::Connection::RequestInfo::totalTime</a></div><div class="ttdeci">double totalTime</div><div class="ttdef"><b>Definition:</b> connection.h:61</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_request_info_html_abcccb563d60a3f5325918ef912130e16"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_request_info.html#abcccb563d60a3f5325918ef912130e16">RestClient::Connection::RequestInfo::preTransferTime</a></div><div class="ttdeci">double preTransferTime</div><div class="ttdef"><b>Definition:</b> connection.h:65</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_request_info_html_af219b63ad58cb52748ba7afd5b2290aa"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_request_info.html#af219b63ad58cb52748ba7afd5b2290aa">RestClient::Connection::RequestInfo::redirectTime</a></div><div class="ttdeci">double redirectTime</div><div class="ttdef"><b>Definition:</b> connection.h:67</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_ac489a801edc621a384cdfb29e7071231"><div class="ttname"><a href="class_rest_client_1_1_connection.html#ac489a801edc621a384cdfb29e7071231">RestClient::Connection::GetInfo</a></div><div class="ttdeci">RestClient::Connection::Info GetInfo()</div><div class="ttdoc">get diagnostic information about the connection object </div><div class="ttdef"><b>Definition:</b> connection.cc:53</div></div>
<div class="ttc" id="restclient_8h_html"><div class="ttname"><a href="restclient_8h.html">restclient.h</a></div><div class="ttdoc">libcurl wrapper for REST calls </div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_a77c9d405950492f9bcec21ce79edd2b3"><div class="ttname"><a href="class_rest_client_1_1_connection.html#a77c9d405950492f9bcec21ce79edd2b3">RestClient::Connection::FollowRedirects</a></div><div class="ttdeci">void FollowRedirects(bool follow)</div><div class="ttdoc">configure whether to follow redirects on this connection </div><div class="ttdef"><b>Definition:</b> connection.cc:115</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_a658af2c6d1300c8a02e7f6436b43b4c9"><div class="ttname"><a href="class_rest_client_1_1_connection.html#a658af2c6d1300c8a02e7f6436b43b4c9">RestClient::Connection::Connection</a></div><div class="ttdeci">Connection(const std::string &amp;baseUrl)</div><div class="ttdoc">constructor for the Connection object </div><div class="ttdef"><b>Definition:</b> connection.cc:28</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_request_info_html"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_request_info.html">RestClient::Connection::RequestInfo</a></div><div class="ttdoc">holds some diagnostics information about a request </div><div class="ttdef"><b>Definition:</b> connection.h:60</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_request_info_html_ab0240290fa51b11468936199ff0c248f"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_request_info.html#ab0240290fa51b11468936199ff0c248f">RestClient::Connection::RequestInfo::redirectCount</a></div><div class="ttdeci">int redirectCount</div><div class="ttdef"><b>Definition:</b> connection.h:68</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_info_html"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_info.html">RestClient::Connection::Info</a></div><div class="ttdoc">holds some diagnostics information about the connection object it came from </div><div class="ttdef"><b>Definition:</b> connection.h:93</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_info_html_a8e9c9ad0c74a6e6f5c73ced7306464d1"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_info.html#a8e9c9ad0c74a6e6f5c73ced7306464d1">RestClient::Connection::Info::headers</a></div><div class="ttdeci">RestClient::HeaderFields headers</div><div class="ttdef"><b>Definition:</b> connection.h:95</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_a3e510fdf8291e9e277df72b0fae0a111"><div class="ttname"><a href="class_rest_client_1_1_connection.html#a3e510fdf8291e9e277df72b0fae0a111">RestClient::Connection::SetUserAgent</a></div><div class="ttdeci">void SetUserAgent(const std::string &amp;userAgent)</div><div class="ttdoc">set custom user agent for connection. This gets prepended to the default restclient-cpp/RESTCLIENT_VE...</div><div class="ttdef"><b>Definition:</b> connection.cc:127</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_aa4353eb1df932b254aa02446f4ac3b32"><div class="ttname"><a href="class_rest_client_1_1_connection.html#aa4353eb1df932b254aa02446f4ac3b32">RestClient::Connection::GetUserAgent</a></div><div class="ttdeci">std::string GetUserAgent()</div><div class="ttdoc">get the user agent to add to the request </div><div class="ttdef"><b>Definition:</b> connection.cc:149</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_a6af41bf467a80deb83f20044f2c17344"><div class="ttname"><a href="class_rest_client_1_1_connection.html#a6af41bf467a80deb83f20044f2c17344">RestClient::Connection::SetHeaders</a></div><div class="ttdeci">void SetHeaders(RestClient::HeaderFields headers)</div><div class="ttdoc">set the custom headers map. This will replace the currently configured headers with the provided ones...</div><div class="ttdef"><b>Definition:</b> connection.cc:91</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_afd74a344a00b58fc6997e34c37dde834"><div class="ttname"><a href="class_rest_client_1_1_connection.html#afd74a344a00b58fc6997e34c37dde834">RestClient::Connection::SetCAInfoFilePath</a></div><div class="ttdeci">void SetCAInfoFilePath(const std::string &amp;caInfoFilePath)</div><div class="ttdoc">set custom Certificate Authority (CA) path </div><div class="ttdef"><b>Definition:</b> connection.cc:139</div></div>
<div class="ttc" id="namespace_rest_client_html_ab2bbc7fd5ec10171e4e1fb2d7fc8e865"><div class="ttname"><a href="namespace_rest_client.html#ab2bbc7fd5ec10171e4e1fb2d7fc8e865">RestClient::HeaderFields</a></div><div class="ttdeci">std::map&lt; std::string, std::string &gt; HeaderFields</div><div class="ttdef"><b>Definition:</b> restclient.h:27</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_a76b11e6e01fb84cafdacf99e49aae6a7"><div class="ttname"><a href="class_rest_client_1_1_connection.html#a76b11e6e01fb84cafdacf99e49aae6a7">RestClient::Connection::post</a></div><div class="ttdeci">RestClient::Response post(const std::string &amp;uri, const std::string &amp;data)</div><div class="ttdoc">HTTP POST method. </div><div class="ttdef"><b>Definition:</b> connection.cc:351</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_ad7b6f92f59861b4c8dc914d4d226d89d"><div class="ttname"><a href="class_rest_client_1_1_connection.html#ad7b6f92f59861b4c8dc914d4d226d89d">RestClient::Connection::SetTimeout</a></div><div class="ttdeci">void SetTimeout(int seconds)</div><div class="ttdoc">set timeout for connection </div><div class="ttdef"><b>Definition:</b> connection.cc:164</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_a60fd7521bfb4f604e6c7cdd278f038b3"><div class="ttname"><a href="class_rest_client_1_1_connection.html#a60fd7521bfb4f604e6c7cdd278f038b3">RestClient::Connection::AppendHeader</a></div><div class="ttdeci">void AppendHeader(const std::string &amp;key, const std::string &amp;value)</div><div class="ttdoc">append a header to the internal map </div><div class="ttdef"><b>Definition:</b> connection.cc:78</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_a4a14035f66375a7291f9d16d87db41f2"><div class="ttname"><a href="class_rest_client_1_1_connection.html#a4a14035f66375a7291f9d16d87db41f2">RestClient::Connection::del</a></div><div class="ttdeci">RestClient::Response del(const std::string &amp;uri)</div><div class="ttdoc">HTTP DELETE method. </div><div class="ttdef"><b>Definition:</b> connection.cc:399</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_af1a30c5aa6a646e6bad4caf2abb7084c"><div class="ttname"><a href="class_rest_client_1_1_connection.html#af1a30c5aa6a646e6bad4caf2abb7084c">RestClient::Connection::put</a></div><div class="ttdeci">RestClient::Response put(const std::string &amp;uri, const std::string &amp;data)</div><div class="ttdoc">HTTP PUT method. </div><div class="ttdef"><b>Definition:</b> connection.cc:370</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_a64f085227c8c4d47dc6c84fea4f71398"><div class="ttname"><a href="class_rest_client_1_1_connection.html#a64f085227c8c4d47dc6c84fea4f71398">RestClient::Connection::head</a></div><div class="ttdeci">RestClient::Response head(const std::string &amp;uri)</div><div class="ttdoc">HTTP HEAD method. </div><div class="ttdef"><b>Definition:</b> connection.cc:417</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_request_info_html_a022ad817c51c37e781d3ef6590b47d96"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_request_info.html#a022ad817c51c37e781d3ef6590b47d96">RestClient::Connection::RequestInfo::startTransferTime</a></div><div class="ttdeci">double startTransferTime</div><div class="ttdef"><b>Definition:</b> connection.h:66</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html"><div class="ttname"><a href="class_rest_client_1_1_connection.html">RestClient::Connection</a></div><div class="ttdoc">Connection object for advanced usage. </div><div class="ttdef"><b>Definition:</b> connection.h:28</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_info_html_a4b194ea487bf48f55e597b3146bc0c9b"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_info.html#a4b194ea487bf48f55e597b3146bc0c9b">RestClient::Connection::Info::followRedirects</a></div><div class="ttdeci">bool followRedirects</div><div class="ttdef"><b>Definition:</b> connection.h:97</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_info_html_a8cec6f505e26773638ea7c2df895b5e8"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_info.html#a8cec6f505e26773638ea7c2df895b5e8">RestClient::Connection::Info::customUserAgent</a></div><div class="ttdeci">std::string customUserAgent</div><div class="ttdef"><b>Definition:</b> connection.h:106</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_info_html_ae908949ed901ed0883da20efad56cf67"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_info.html#ae908949ed901ed0883da20efad56cf67">RestClient::Connection::Info::baseUrl</a></div><div class="ttdeci">std::string baseUrl</div><div class="ttdef"><b>Definition:</b> connection.h:94</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_request_info_html_a05d4f74f97a3e02cb9bbe3a6039135bc"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_request_info.html#a05d4f74f97a3e02cb9bbe3a6039135bc">RestClient::Connection::RequestInfo::appConnectTime</a></div><div class="ttdeci">double appConnectTime</div><div class="ttdef"><b>Definition:</b> connection.h:64</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_request_info_html_a7c8347cc41e35a944663d333baea88a9"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_request_info.html#a7c8347cc41e35a944663d333baea88a9">RestClient::Connection::RequestInfo::connectTime</a></div><div class="ttdeci">double connectTime</div><div class="ttdef"><b>Definition:</b> connection.h:63</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_request_info_html_a73d3bab1fd832feb912f1e20656b185d"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_request_info.html#a73d3bab1fd832feb912f1e20656b185d">RestClient::Connection::RequestInfo::nameLookupTime</a></div><div class="ttdeci">double nameLookupTime</div><div class="ttdef"><b>Definition:</b> connection.h:62</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_info_html_ac9393ffec292dc9ef1f9378bf0df5f31"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_info.html#ac9393ffec292dc9ef1f9378bf0df5f31">RestClient::Connection::Info::lastRequest</a></div><div class="ttdeci">RequestInfo lastRequest</div><div class="ttdef"><b>Definition:</b> connection.h:107</div></div>
<div class="ttc" id="class_rest_client_1_1_connection_html_a9fdc2ee1b3b2cc2cca1f9fd29e6fd73f"><div class="ttname"><a href="class_rest_client_1_1_connection.html#a9fdc2ee1b3b2cc2cca1f9fd29e6fd73f">RestClient::Connection::SetBasicAuth</a></div><div class="ttdeci">void SetBasicAuth(const std::string &amp;username, const std::string &amp;password)</div><div class="ttdoc">set username and password for basic auth </div><div class="ttdef"><b>Definition:</b> connection.cc:176</div></div>
<div class="ttc" id="struct_rest_client_1_1_connection_1_1_info_html_a0a63e442ce474e50017fcbae563c4a7c"><div class="ttname"><a href="struct_rest_client_1_1_connection_1_1_info.html#a0a63e442ce474e50017fcbae563c4a7c">RestClient::Connection::Info::timeout</a></div><div class="ttdeci">int timeout</div><div class="ttdef"><b>Definition:</b> connection.h:96</div></div>
<div class="ttc" id="namespace_rest_client_html"><div class="ttname"><a href="namespace_rest_client.html">RestClient</a></div><div class="ttdoc">namespace for all RestClient definitions </div><div class="ttdef"><b>Definition:</b> connection.h:23</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Dec 2 2016 10:53:09 for restclient-cpp by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
